#!/bin/sh

FQDN=`hostname -f`

if [ "x$FQDN" != "xhelio.me.umn.edu" -a "x$FQDN" != "xstinson.me.umn.edu" ]; then
    echo "$0 must be run on helio.me.umn.edu (or stinson)"
    exit
fi

# Push to these servers

SOURCE=~/Projects/SimGear/ftp/*

# Master simgear ftp
DEST=curt@baron.flightgear.org:/fgfs03/ftp/pub/simgear/

# Backup simgear ftp
DEST=curt@seneca.flightgear.org:/export/fgfs07/ftp/pub/simgear/

for DEST in \
    curt@baron.flightgear.org:/fgfs03/ftp/pub/simgear/ \
    curt@seneca.flightgear.org:/export/fgfs07/ftp/pub/simgear/; \
    do
    
    echo mirroring from $SOURCE to $DEST

    rsync --verbose --archive --delete \
        --rsh ssh -v \
        $SOURCE $DEST 2>&1
done


# Now send an email to trigger uni-duisburg.de "pull" 

Mail -s "StartFlightGearRsync" mas@ihg.uni-duisburg.de < /dev/null

